#ifndef MESH_HH
# define MESH_HH

# include <GL/glew.h>

# include <libxml/parser.h>

# include "object.hh"
# include "pos.hh"

class Mesh: public Object
{
public:

  virtual void dispatch () const;
  friend class ContentHandler;

protected:
  //vbo
  GLuint vbo_;
  Posf* data_;
  int datasize_;

  //ibo
  GLuint ibo_;
  uint* idata_;
  int idatasize_;

  Mesh (const Vector3f& pos, const Vector3d& rotate, Bounding* bounding, Mesh* m);
  Mesh (const std::string& path);

  void build_vbo (xmlNodePtr cur, xmlDocPtr doc);
  void build_ibo (xmlNodePtr cur, xmlDocPtr doc);

  static Mesh* m;
};

# endif /// !MESH_HH
